package com.qf.day02;

import java.util.Scanner;

/**
 * 会员购物时，根据输入积分的不同享受不同的折扣
 * 计算会员购物时获得的折扣输出实付金额
 * 会员积分x 折扣
 * x ＜ 2000 9折
 * 2000 ≤ x ＜ 4000 8折
 * 4000 ≤ x ＜ 8000 7折
 * x ≥ 8000 6折
 */
public class Discount {
    public static void main(String[] args) {
        System.out.println("请输入价格");
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        System.out.println("请输入会员积分");
        double price=scanner.nextDouble();
        if(x<2000&x>0){
            price = price*0.9;
            System.out.println("需付金额："+price);
        }else if(2000<=x&&x<4000){
            price = price*0.8;
            System.out.println("需付金额："+price);
        }
        else if(4000<=x&&x<8000){
            price =price*0.7;
            System.out.println("需付金额："+price);
        }else if(8000<=x) {
            price = price * 0.6;
            System.out.println("需付金额："+price);
        }else {
            System.out.println("输入错误");
        }

    }

}
